<template>
  <div>
    <el-menu
      style="width: 1226px;margin: 0 auto;display: flex;position: relative"
      :default-active="activeIndex2"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b">
      <el-menu-item index="1" @click="gotoindex">首页</el-menu-item>
      <el-submenu index="2">
        <template slot="title">高考咨询</template>
        <el-menu-item index="2-1" @click="gotopolicy">高考政策信息</el-menu-item>
        <el-menu-item index="2-2" @click="gotostubro">高考招生简章</el-menu-item>
      </el-submenu>
      <el-menu-item index="3" @click="gotoschool">院校库</el-menu-item>
      <el-menu-item index="4" @click="gotomajor">专业库</el-menu-item>
      <el-submenu index="5">
        <template slot="title" @click="gotoQuestion">问卷测评</template>
        <el-menu-item index="5-1" @click="gotoQuestion">职业性格测试</el-menu-item>
        <el-menu-item index="5-2">行测</el-menu-item>
      </el-submenu>
      <el-submenu index="6">
        <template slot="title" @click="gotoselect">一分一档</template>
        <el-menu-item index="6-1">河北省</el-menu-item>
        <el-menu-item index="6-2">其他</el-menu-item>
      </el-submenu>
      <el-menu-item index="7" @click="gotolimitmajor">限选课</el-menu-item>
      <el-menu-item index="8">志愿推荐</el-menu-item>
      <el-menu-item index="9" @click="gotoforum">论坛</el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'Header',
  data () {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    }
  },
  methods: {
    handleSelect (key, keyPath) {
      console.log(key, keyPath)
    },
    gotoindex () {
      this.$router.push({
        path: '/'
      })
    },
    gotopolicy () {
      this.$router.push({
        path: '/policy'
      })
    },
    gotostubro () {
      this.$router.push({
        path: '/stubro'
      })
    },
    gotoschool () {
      this.$router.push({
        path: '/school'
      })
    },
    gotomajor () {
      this.$router.push({
        path: '/major'
      })
    },
    gotoselect () {
      this.$router.push({
        path: '/selectone'
      })
    },
    gotolimitmajor () {
      this.$router.push({
        path: '/limitmajor'
      })
    },
    gotoforum () {
      this.$router.push({
        path: '/forum'
      })
    },
    gotoQuestion () {
      this.$router.push({
        path: '/Question'
      })
    }
  }
}
</script>

<style scoped>
.school-logo{
  width: 55px;
  height: 55px;
  background: url(../assets/xiaohuismall.png) no-repeat;
}
</style>
